/**
 * Created by cchen on 2015/4/28.
 */

module.exports = function (app) {
    var service = require('../../controllers/backoffice/backOffice-serviceAsUser-controller');
    logger.debug("load the backoffice serviceAsUser module....");

    //rest路由
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/admin/createUserForService/:serviceId/:community', service.createUserForService);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/admin/createServiceUserChain/:serviceId/:userId', service.createServiceUserChain);
    app.delete('/rest/' + RESTFullServiceVersion + '/backoffice/admin/removeServiceUserChain/:serviceId', service.removeServiceUserChain);

    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/admin/availableCommunities', service.availableCommunities)
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/admin/getAllUnbindedServiceUser', service.getAllUnbindServiceUser)
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/admin/getBindedServiceUser/:serviceId', service.getBindedServiceUser)

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/admin/updateSignedService', service.updateSignedService);

};